FROM centos:7.9.2009

MAINTAINER zhangyw<xxx@163.com>

RUN set -x && \
    yum -y install --setopt=protected_multilib=false libgssapi_krb5.so.2 libxml2.so.2 libstdc++.so.5 && \
    yum -y install --setopt=protected_multilib=false xulrunner.i686 xulrunner-devel.i686 && \
    yum -y install --setopt=protected_multilib=false glibc.i686 && \
    yum clean all && \
    ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone

ENV BASE_DIR "/zxserver"
ENV LD_LIBRARY_PATH $BASE_DIR/lib

RUN mkdir -p $BASE_DIR && \ 
    mkdir -p $BASE_DIR/logs
WORKDIR $BASE_DIR

ADD ./bin ./bin
ADD ./zxserver/lib ./lib
ADD ./zxserver/gamedbd ./gamedbd
ADD ./zxserver/toplist ./toplist
ADD ./zxserver/uniquenamed ./uniquenamed

# 复制配置
COPY ./config/gamedbd/gamesys.conf ./gamedbd/gamesys.conf
COPY ./config/toplist/gamesys.conf ./toplist/gamesys.conf
COPY ./config/uniquenamed/gamesys.conf ./uniquenamed/gamesys.conf

# TODO 设置toplist 定时更新脚本

VOLUME $BASE_DIR/data

EXPOSE 29400 29401

CMD ["/bin/sh","-c", "./bin/start-gdb.sh && tail -f /dev/null"]